﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace VideoWorld.Business
{
    /// <summary>
    /// Videos 的摘要说明。
    /// </summary>
    public class Videos
    {
        //添加影片类型
        public static string AddVideoType(string videoTypeName, string videoTypeSummary)
        {
            string errorMessage = "";
            int errorCode = DataAccess.Videos.AddVideoType(videoTypeName, videoTypeSummary);
            switch (errorCode)
            {
                case 1:
                    errorMessage = "添加成功";
                    break;
                case -1:
                    errorMessage = "添加失败";
                    break;
            }
            return errorMessage;
        }
        //更新影片类型
        public static string UpdateVideoType(string videoTypeID, string videoTypeName, string videoTypeSummary)
        {
            string errorMessage = "";
            int errorCode = DataAccess.Videos.UpdateVideoType(videoTypeID, videoTypeName, videoTypeSummary);
            switch (errorCode)
            {
                case 1:
                    errorMessage = "更新成功";
                    break;
                case -1:
                    errorMessage = "更新失败";
                    break;
            }
            return errorMessage;
        }
        //删除影片类型
        public static string DeleteVideoType(string videoTypeID)
        {
            string errorMessage = "";
            int errorCode = DataAccess.Videos.DeleteVideoType(videoTypeID);
            switch (errorCode)
            {
                case 1:
                    errorMessage = "删除成功";
                    break;
                case -1:
                    errorMessage = "删除失败";
                    break;
            }
            return errorMessage;
        }
    }
}

